import 'package:json_annotation/json_annotation.dart';

//终端执行命令 flutter packages pub run build_runner build生成此文件
part 'house_details_data.g.dart';

@JsonSerializable()
class RoomDetailData {
  // 将你写的参数类型转换成name里的
  @JsonKey(name: 'houseCode')
  String? id;
  String? title;
  String? community;
  @JsonKey(name: 'description')
  String? subTitle;
  int? size;
  String? floor;
  String? decorationType; //装修类型
  int? price;
  String? roomType; //房型

  @JsonKey(name: 'houseImg')
  List<String>? houseImgs;

  List<String>? tags;
  List<String>? oriented; //朝向

  @JsonKey(name: 'supporting')
  List<String>? applicances;

  RoomDetailData(
      {this.id,
      this.title,
      this.community,
      this.subTitle,
      this.size,
      this.roomType,
      this.houseImgs,
      this.tags,
      this.price,
      this.floor,
      this.oriented,
      this.applicances,
      this.decorationType});

  factory RoomDetailData.fromJson(Map<String, dynamic> json) =>
      _$RoomDetailDataFromJson(json);

  Map<String, dynamic> toJson() => _$RoomDetailDataToJson(this);
}
